-
Notifications
You must be signed in to change notification settings - Fork 0
[C] Update pypi update and fixed rasterize numpy error
#10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[C] Update pypi update and fixed rasterize numpy error
#10
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR modernizes PyFace's packaging and PyPI release workflow by adopting cibuildwheel for cross-platform wheel building, updating dependencies to support NumPy 2, and renaming the package to avoid PyPI conflicts. The changes ensure proper PyPI distribution with both source distributions and pre-built wheels.
- Migrated from manual wheel building to cibuildwheel for standardized Linux wheel generation
- Updated package dependencies to support NumPy 2 and modern Python tooling
- Renamed package from "pyface" to "pyface-docsaid" to avoid PyPI naming conflicts
Reviewed Changes
Copilot reviewed 6 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| setup.py | Refactored build system to handle NumPy 2 compatibility and proper include paths |
| setup.cfg | Removed legacy configuration file in favor of pyproject.toml |
| pyproject.toml | Updated package metadata, dependencies, and build requirements |
| pyface/init.py | Bumped version from 0.1.0 to 0.1.2 |
| MANIFEST.in | Added manifest to include necessary files in source distribution |
| .github/workflows/release.yml | Modernized CI workflow to use cibuildwheel and proper PyPI publishing |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
setup.py
Outdated
| import subprocess | ||
| import sys | ||
|
|
||
| subprocess.check_call([sys.executable, "-m", "pip", "install", "numpy>2.0"]) |
Copilot
AI
Aug 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The version constraint 'numpy>2.0' excludes NumPy 2.0.x versions. This should be 'numpy>=2.0' to include NumPy 2.0 and later versions, consistent with the pyproject.toml dependency specification.
| subprocess.check_call([sys.executable, "-m", "pip", "install", "numpy>2.0"]) | |
| subprocess.check_call([sys.executable, "-m", "pip", "install", "numpy>=2.0"]) |
| "pyface/components/face_depth/Sim3DR", | ||
| np.get_include(), | ||
| ] | ||
| # 有些 runner 只放其中一個,把能拿到的全加進去 |
Copilot
AI
Aug 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The comment is in Chinese but the codebase appears to use English comments elsewhere. Consider translating to English: '# Some runners only have one of these, add all available paths'
| # 有些 runner 只放其中一個,把能拿到的全加進去 | |
| # Some runners only have one of these, add all available paths |
pyproject.toml
Outdated
| "setuptools>=69", | ||
| "wheel", | ||
| "Cython>=3.0.10", | ||
| "numpy>=2" # 建置時使用 NumPy 2 的 header |
Copilot
AI
Aug 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The comment is in Chinese. Consider translating to English: '# Use NumPy 2 headers during build'
| "numpy>=2" # 建置時使用 NumPy 2 的 header | |
| "numpy>=2" # Use NumPy 2 headers during build |
| "Topic :: Software Development :: Libraries :: Python Modules" | ||
| ] | ||
| dependencies = [ | ||
| "numpy>=2", # 執行期也支援 NumPy 2 |
Copilot
AI
Aug 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The comment is in Chinese. Consider translating to English: '# Runtime also supports NumPy 2'
| "numpy>=2", # 執行期也支援 NumPy 2 | |
| "numpy>=2", # Runtime also supports NumPy 2 |
pyproject.toml
Outdated
| "numpy>=2", # 執行期也支援 NumPy 2 | ||
| "scikit-image", | ||
| "capybara_docsaid", | ||
| "capybara-docsaid", # ← 與 setup.cfg 統一,使用連字號 |
Copilot
AI
Aug 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The comment is in Chinese and references the now-deleted setup.cfg file. Consider updating to English: '# Use hyphen for consistency'
| "capybara-docsaid", # ← 與 setup.cfg 統一,使用連字號 | |
| "capybara-docsaid", # Use hyphen for consistency |
a42cb78 to
854c838
Compare
854c838 to
5410158
Compare
06b56b5 to
3f2d4f8
Compare
Coverage Report
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
10fcc64 to
6a177f0
Compare
bf3e097 to
1fe7814
Compare
e81d6ce to
05f5723
Compare
07e4b8c to
d485e94
Compare
d485e94 to
d10f16b
Compare
|
This pull request refactors the CI/CD workflows to improve platform support, modularity, and maintainability. It splits the previous monolithic CI workflow into separate CPU and CUDA workflows, updates the release workflow to build and publish wheels for multiple platforms, and makes supporting code changes for consistency and usability. Additionally, it updates model class initializers for clarity and improves packaging. Workflow and CI/CD Improvements:
Release Process Modernization:
Packaging and Build Improvements:
Codebase Consistency and Usability:
These changes together modernize the project's CI/CD pipeline, improve release reliability, and make the codebase easier to maintain and use. |
kunkunlin1221
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
摘要
本 PR 將 PyFace 的發佈流程全面更新,採用現代化的建置方式(
cibuildwheel),並同步清理舊有設定,確保套件能正確地在 PyPI 上發佈並支援新版依賴(如 NumPy 2)。主要變更
🛠️ GitHub Actions Workflow
工作名稱從
Release改為release(符合命名慣例)。移除 Python 版本矩陣,改由
cibuildwheel控制建置:CIBW_BUILD:cp310-* cp311-* cp312-*CIBW_SKIP: 跳過 PyPy 與 musllinuxCIBW_ARCHS: 限定 x86_64CIBW_MANYLINUX_X86_64_IMAGE:manylinux_2_28安裝建置工具:
build、twine、cibuildwheel。流程調整:
發佈至 GitHub Release 時,會同時附上
.tar.gz與.whl。新增檔案清理步驟,確保
dist/、wheelhouse/、*.egg-info不殘留。📦 套件與中繼資料
專案名稱由
pyface改為pyface-docsaid(避免 PyPI 命名衝突)。新增
MANIFEST.in:README.md、LICENSESim3DR相關 Cython 檔案(*.pyx、*.pxd、*.h、*.cpp)更新
pyproject.toml:依賴調整:
setuptools>=69Cython>=3.0.10numpy>=2(建置與執行期都支援 NumPy 2)依賴名稱統一:
capybara-docsaid(與 setup.cfg 對齊)metadata 格式修正(license、authors 等)。
明確包含
pyface*套件。移除舊有
setup.cfg。版本號更新:
0.1.0→0.1.2。⚙️ 建置系統(setup.py)
移除過去在建置時動態安裝套件的 hack。
新增 include paths:NumPy header、Python header、Sim3DR。
使用
cythonize時設定language_level=3。編譯目標調整為:
確保相容於新版 Cython 與 NumPy。
🧹 其他修正
.gitignore:忽略Sim3DR產生的 C/C++ 檔案。動機
預期影響
pip install pyface-docsaid並獲得預建 wheels。sdist與 wheels。Checklist
cibuildwheel成功建置 Linux wheelstwine check驗證發佈檔案.tar.gz+.whlsetup.cfg0.1.2